@use "../mixins/config" as *;
@use "../mixins/function" as *;

/* 自定义页面样式 */
.#{$namespace}-page {
  max-width: getCssVar("page-width");
  margin: 1.5rem auto;
  padding: 20px 30px;
  box-shadow: var(--vp-shadow-3);
  border-radius: 10px;
  background-color: getCssVar("bg-color-1");

  /* 隐藏 md 内容 */
  & ~ div:not(.#{$namespace}-page) {
    display: none;
  }
}

/* 自定义页面一级标题样式 */
.#{$namespace}-page-title-h1 {
  font-size: 2rem;
  line-height: 2rem;
  font-weight: 600;
}

/* 自定义页面二级标题样式 */
.#{$namespace}-page-title-h2 {
  font-size: 1.7rem;
  line-height: 1.7rem;
  font-weight: 600;
}

/* 自定义页面三级标题样式 */
.#{$namespace}-page-title-h3 {
  font-size: 1.4rem;
  line-height: 1.4rem;
  font-weight: 500;
}

.#{$namespace}-pointer {
  cursor: pointer;
}

.#{$namespace}-center {
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.#{$namespace}-layout .VPContent .VPDoc {
  /* 文章内容宽度加大 */
  .container {
    max-width: var(--vp-content-container, 1104px);
    @media (min-width: 960px) {
      max-width: var(--vp-content-container, 992px);
    }
  }

  .content {
    max-width: var(--vp-content-container, 784px);
    @media (min-width: 960px) {
      max-width: var(--vp-content-container, 752px);
    }
  }

  &.has-aside .content-container {
    max-width: var(--vp-content-container, 688px);
  }
}

a.hover-color:hover {
  color: getCssVar("theme-color");
  cursor: pointer;
}

/* flex */
.flx {
  display: flex;
}

.flx-column {
  display: flex;
  flex-direction: column;
}

.flx-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flx-column-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.flx-align-center {
  display: flex;
  align-items: center;
}

.flx-justify-center {
  display: flex;
  justify-content: center;
}

.flx-justify-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flx-justify-around {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.flx-start-justify-center {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.flx-wrap-between {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.flx-wrap-justify-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* 文字单行省略号 */
.sle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文字多行省略号 */
.mle {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

/* 文字多了自动换行 */
.break-word {
  word-break: break-all;
  word-wrap: break-word;
}
